import * as ApiUtil from '@/api/index';

const api = {
  userList: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/user/list'),
  userSave: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/user/save'),
  userDelete: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/user/delete'),
};

export interface User {
  id: string;
  userName: string;
  password: string;
  role: number;

  gcId: string;
  updateDateTime: string;
}

export function userList() {
  return ApiUtil.getI5xforyou(api.userList);
}

export function userSave(data?: object) {
  return ApiUtil.postI5xforyou(api.userSave, data);
}

export function userDelete(data?: object) {
  return ApiUtil.postI5xforyou(api.userDelete, data);
}
